#include <stdio.h>
#include <unistd.h>
int main(){
  //printf("begin.......\n");
  //printf("begin.......\n");
  //printf("begin.......\n");
  //printf("begin.......\n");
  //execl("/bin/ls","ls","-a","-l",NULL);
  //printf("end.....\n");
  //printf("end.....\n");
  //printf("end.....\n");
  //printf("end.....\n");
  //printf("end.....\n");
  
  pid_t id = fork();
  if(id==0){
    printf("我是子进程，pid:%d\n",getpid());
    execl("/bin/ls","ls","-a","-l",NULL);
  }
  sleep(2);
  printf("我是父进程，pid:%d\n",getpid());
  return 0;
}
